import axios from "axios";

// 获取子菜单
let list = (params) => axios.get('/api/menu/sub', { params });

let edit = (data) => axios.put('/api/menu', data);

let icon = (data) => axios.put('/api/menu/icon', data);

//添加自己菜单
let add = (data) => axios.post('/api/menu', data);

//删除子菜单
let remove = (params) => axios.delete('/api/menu', { params })

let config = (params) => axios.get('/api/menu/tree', { params });

//添加菜单
let addrole = (data) => axios.post('/api/role/menu', data);
//删除菜单
let removerole = (params) => axios.delete('/api/role/menu', { params });

export default {
	list,
	edit,
	icon,
	add,
	remove,
	config,
	addrole,
	removerole
}
